package com.xx.servlte;

import com.xx.service.AuctionService;
import com.xx.service.Impl.AuctionServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet(name = "deleteServlet",urlPatterns = "/deleteServlet")
public class deleteServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //获取请求数据
        Integer auctionId=Integer.valueOf(request.getParameter("auctionId"));
        //操作
        AuctionService dao=new AuctionServiceImpl();
        int ret=dao.delete(auctionId);
        PrintWriter out=response.getWriter();
        out.print(ret);
        out.flush();
        out.close();
    }
}
